import request from '@/utils/request'
import { getToken } from '@/utils/auth'

export function fetchList(query) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/distributor/getDistributors',
    method: 'get',
    params: query
  })
}

export function getMaterialDetails(shipmentNo) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/shipment/selectByShipmentNo/' + shipmentNo,
    method: 'get',
    params: null
  })
}

export function addDistributor(data) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/distributor/addDistributor',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data
  })
}

export function updateDetailByid(data) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/distributor/deleteDistributorByid',
    method: 'get',
    params: data
  })
}
